#!/bin/bash
DIR_data=`pwd`
fitfile=$1
zeroname=Zero.fit
darkname=Dark.fit
flatname=$2
if [ $# -ne 2   ]
then
	echo "usage: input file is fitfile flat.fit"
	exit 0
fi
#============================
cd $HOME/iraf1
cp -f login.cl.old login.cl
echo noao >> login.cl
echo imred >>login.cl
echo ccdred >>login.cl
echo "cd $DIR_data" >> login.cl
echo $fitfile $zeroname $darkname $flatname
echo "ccdpro(images=\"$fitfile\", output=\"  \",ccdtype-, trim-,zerocor+,darkcor+,flatcor+,zero=\"$zeroname\", dark=\"$darkname\",flat=\"$flatname\")" >>login.cl
echo logout >> login.cl
cl < login.cl
#cl < login.cl >xlogfile
cd $HOME/iraf1
cp -f login.cl.old login.cl
cd $DIR_data
